﻿using System;
using System.Collections.Generic;
using System.Text;
using Madason.MetaModel;

namespace Madason.Templates.Schema
{
    public class SchemaTypeMapper
    {
        Dictionary<string, string> typeMap = new Dictionary<string, string>();

        public SchemaTypeMapper()
        {
            typeMap["string"] = "xs:string";
            typeMap["DateTime"] = "xs:date";
        }

        public bool IsSubElement(Class cls)
        {
            return !typeMap.ContainsKey(cls.Name);
        }

        public string GetSchemaType(Class cls)
        {
            if (typeMap.ContainsKey(cls.Name))
                return typeMap[cls.Name];

            return "xs:unknown";
        }

    }
}
